<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>商品信息</title>
<%@ include file="/page/include.jsp"%>
<link href="<%=basePath%>/statics/plugins/iCheck/skins/all.css" rel="stylesheet"> 
<script type="text/javascript" charset="utf-8" src="<%=basePath%>/statics/plugins/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="<%=basePath%>/statics/plugins/ueditor/ueditor.all.min.js"></script>

<link type="text/css" rel="stylesheet" href="<%=basePath%>/statics/plugins/bootstrap-switch/bootstrap-switch.min.css" />
<link href="<%=basePath%>/statics/css/webform.css?v=20180104" rel="stylesheet" />
<script src="<%=basePath%>/statics/js/webform.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="${rootPath }/statics/js/jquery-ui.js"></script>
<!--建议手动加载语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="${rootPath }/statics/plugins/ueditor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
var SystemImgPath = '<%=PublicConfig.IMG_ROOT_URL%>';
</script>

</head>
<body class="nav-md" style="background-color: #f7f7f7">
	<div class="container body">
		<div class="main_container">
			<div class="framebody" style="min-height: 100%;" role="main">
				<input type="hidden" id="opFlag" value="${opFlag }" />
				<%-- 隐藏域 --%>
					<input type="hidden" name="id" id="id" value="${product.id }">
					<!-- 新增、修改操作结果 1=成功，0=失败-->
					<input id="opt_status" value="" hidden="hidden">
				<%-- 隐藏域 --%>
				<%-- <blockquote class="ui-elem-quote">
					<h3><a href="${rootPath}/product/toListProductPage" style="color:#00A1FE;">商品列表</a>&gt;<a href="#" style="color:#00A1FE;">商品信息编辑</a></h3>
				</blockquote> --%>
				<ul id="productTab" class="nav nav-tabs">
					<li  id="baseLi" class="active"><a href="#baseTab" data-toggle="tab" onclick="javascript: doSelectTab('base');">基本信息</a></li>
					<li  id="priceLi"><a href="#priceTab" data-toggle="tab" onclick="javascript: doSelectTab('price');">价格设置</a></li>
					<li  id="normsLi"><a href="#normsTab" data-toggle="tab" onclick="javascript: doSelectTab('norms');">规格设置</a></li>
					<li  id="visibleLi"><a href="#visibleTab" data-toggle="tab" onclick="javascript: doSelectTab('visible');">不可见设置</a></li>
					<li  id="descLi"><a href="#descTab" data-toggle="tab" onclick="javascript: doSelectTab('desc');">图文描述</a></li>
					<li  id="relaLi"><a href="#relaTab" data-toggle="tab" onclick="javascript: doSelectTab('rela');">关联商品</a></li>
				</ul>
				
				<div id="myTabContent" class="tab-content">
					<!-- 基本信息 Tab begin -->
					<div id="baseTab" class="tab-pane fade in active">
						<form class="form-horizontal form-label-left" id="baseForm" name="baseForm" method="post"
							action="<%=basePath%>/product/addProductBase">
							<div class="panel panel-default">
								<div class="panel-heading">基本信息</div>
								<div class="panel-body">
									<div class="item form-group">
										<label class="control-label col-md-2">商品编码：</label>
										<div class="col-md-5">
											<input id="productCode" name="productCode" value="${product.productCode }" readonly="readonly" class="form-control col-md-12"  type="text" >
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2"><font color="red">*</font>商品名称：</label>
										<div class="col-md-5">
											<input id="productName" name="productName" value="${product.productName }" class="form-control col-md-12" maxlength="100" placeholder="请输入商品名称" type="text" >
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2">商品副标题：</label>
										<div class="col-md-5">
											<input id="productTitle" name="productTitle" value="${product.productTitle }" class="form-control col-md-12" maxlength="100" placeholder="请输入商品副标题" type="text" >
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2"><font color="red">*</font>商品品牌：</label>
										<div class="col-md-5">
											<select class="selectpicker form-control col-md-12" id="brandCode" name="brandCode">
												<option value="">全部</option>
											</select>
											<input type="hidden" id="brand" value="${product.brandCode }" />
										</div>
										<div class="col-md-2" style="height:30px;padding-top:6px;">
											<a href="#" onclick="javascript: void('');" id="btnBrandAdd">+新增品牌</a>
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2">商品子品牌：</label>
										<div class="col-md-5">
											<select class="selectpicker form-control col-md-12" id="childBrandCode" name="childBrandCode">
												<option value="">全部</option>
											</select>
											<input type="hidden" id="childBrand" value="${product.childBrandCode }" />
										</div>
										<div class="col-md-2" style="height:30px;padding-top:6px;">
											<a href="#" onclick="javascript: void('');" id="btnChildBrandAdd">+新增子品牌</a>
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2"><font color="red">*</font>商品分类：</label>
										<div class="col-md-5" id="productCategoryTree">
										
											<input id="productCategoryId" placeholder="商品分类" type="hidden" value="${product.productCategoryId }">
											<input id="productCategoryName" readonly="readonly" name="productCategoryName" value="${product.productCategoryName }" class="form-control col-md-12" placeholder="请选择商品分类" type="text">
											<i class="glyphicon glyphicon-chevron-down" style="z-index: 100;padding-left: 95%;margin-top: -25px;" onclick="javascript: doChoseProductCategory();"></i>
											<!-- <input id="productCategoryId" name="productCategoryId" class="form-control col-md-12" placeholder="请选择商品分类" type="text" > -->
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2"><font color="red">*</font>计量单位：</label>
										<div class="col-md-5">
											<input type="hidden" id="salesUnit" value="${product.productSalesUnit }" />
											<select class="selectpicker form-control col-md-12" id="productSalesUnit" name="productSalesUnit">
												<option value="">全部</option>
											</select>
										</div>
										<div class="col-md-2" style="height:30px;padding-top:6px;">
											<a href="#" onclick="javascript: void('');" id="btnProductUnitAdd">+新增单位</a>
										</div>
									</div>
									
									<div class="item form-group">
										<label class="control-label col-md-2">商品关键字：</label>
										<div class="col-md-5">
											<input id="keyWord" name="keyWord" value="${product.keyWord }" class="form-control col-md-12" maxlength="100" placeholder="请输入商品关键字[用空格隔开]" type="text" >
										</div>
										<div class="col-md-5" style="height:30px;padding-top:6px;">
											商品搜索关键字，用空格隔开！
										</div>
									</div>
									
									<div class="x_title">
										<div class="clearfix"></div>
									</div>
									<div class="item form-group">
										<label>属性/标签</label>
										<input type="hidden" id="productCategoryVal" value="${product.productCategoryId }" />
										<input type="hidden" id="properties" value="${product.properties }" /> 
										<input type="hidden" id="propertyTmeplateId" value="${product.propertyTmeplateId }" />
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2">商品属性模板：</label>
										<div class="col-md-10" style="padding-top: 6px;" id="productPropertyTemplateDiv">
										</div>
									</div>
									<%--商品属性JS控制 begin --%>
									<div id="productPropertyDiv" class="col-md-12">
									</div>
									<%--商品属性JS控制 end --%>
									<div class="x_title">
										<div class="clearfix"></div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2">商品标签：</label>
										<div class="col-md-10">
											<input type="hidden" id="productTagTxt" value="${product.productTag }" />
											<c:choose>
												<c:when test="${not empty product.productTag }">
													<c:set var="productTagArr" value="${ fn:split(product.productTag, ',') }" ></c:set>
													<c:forEach items="${productTagList }" var="productTag" varStatus="s">
														<c:set var="existsFlag" value="false" ></c:set>
														<c:forEach items="${productTagArr }" var="childTag" varStatus="c">
															<c:if test="${childTag eq productTag.id }">
																<c:set var="existsFlag" value="true"></c:set>
															</c:if>
														</c:forEach>
														
														<c:choose>
															<c:when test="${existsFlag }">
																<div class="divcheck" id="productTagDiv${s.index }" name="productTagDiv" title="${productTag.id }" onclick="javascript: doSetTagMulValue(this);">${productTag.tagName }</div>
															</c:when>
															<c:otherwise>
																<div class="divuncheck" id="productTagDiv${s.index }" name="productTagDiv" title="${productTag.id }" onclick="javascript: doSetTagMulValue(this);">${productTag.tagName }</div>
															</c:otherwise>
														</c:choose>
													</c:forEach>
												</c:when>
												<c:otherwise>
													<c:forEach items="${productTagList }" var="productTag" varStatus="s">
														<div class="divuncheck" id="productTagDiv${s.index }" name="productTagDiv" title="${productTag.id }" onclick="javascript: doSetTagMulValue(this);">${productTag.tagName }</div>
													</c:forEach>
												</c:otherwise>
											</c:choose>
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2">活动标签：</label>
										<div class="col-md-10">
											<%-- 
											<c:forEach items="${promotionTagList }" var="promotionTag" varStatus="s">
												<input limit="promotionTag" type="radio" <c:if test="${product.promotionTag == promotionTag.keyValue }"> checked="checked" </c:if> name="promotionTag" value="${promotionTag.keyValue }"/>
												<label tag="labelCheck"><i></i><span>${promotionTag.keyIntro }</span>
												</label>
											</c:forEach> 
											--%>
											<input type="hidden" id="promotionTagTxt" value="${product.promotionTag }" />
											<c:forEach items="${promotionTagList }" var="promotionTag" varStatus="s">
												<c:choose>
													<c:when test="${product.promotionTag eq promotionTag.id }">
														<div class="divcheck" id="promotionTagDiv${s.index }" name="promotionTagDiv" title="${promotionTag.id }" onclick="javascript: doSetTagValue(this,'promotionTagTxt');">${promotionTag.tagName }</div>
													</c:when>
													<c:otherwise>
														<div class="divuncheck" id="promotionTagDiv${s.index }" name="promotionTagDiv" title="${promotionTag.id }" onclick="javascript: doSetTagValue(this,'promotionTagTxt');">${promotionTag.tagName }</div>
													</c:otherwise>
												</c:choose>
											</c:forEach>
										</div>
									</div>
								</div>
							</div>
							<div class="item form-group">
								<p>
									<input type="button" class="btn btn-default" value="返回" style="margin-right:30px" id="btn_back" onclick="javascript: history.go(-1);" />
									<input type="button" class="btn btn-primary" value="保存并下一步"  id="btnSaveBase" />
								</p>
							</div>
						</form>
					</div>
					<!-- 基本信息 Tab end -->
					<!-- 价格设置Tab begin -->
					<div id="priceTab" class="tab-pane fade">
						<form class="form-horizontal form-label-left" id="priceForm" name="priceForm" method="post"
							action="<%=basePath%>/product/addProductPrice">
							<div class="panel panel-default">
								<div class="panel-heading">价格设置</div>
								<div class="panel-body">
									<div class="item form-group">
										<label class="control-label col-md-2"><font color="red">*</font>最大积分兑换比例：</label>
										<div class="col-md-3">
											<input id="pointExchangeRate" name="pointExchangeRate" value="<fmt:formatNumber type="number" value="${product.pointExchangeRate == null ? 10 : product.pointExchangeRate }" pattern="0.00" maxFractionDigits="2"/>" validate="{required:true,isNoInteger:true}" class="form-control col-md-12"  type="text" >
										</div>
										<div class="col-md-1" style="height:30px;padding-top:6px;">%</div>
										
										<label class="control-label col-md-2"><font color="red">*</font>商品积分系数：</label>
										<div class="col-md-3">
											<input id="pointCieffucuebt" name="pointCieffucuebt" value="<fmt:formatNumber type="number" value="${product.pointCieffucuebt == null ? 1 : product.pointCieffucuebt  }" pattern="0.00" maxFractionDigits="2"/>" validate="{required:true,isNoInteger:true}" class="form-control col-md-12"  type="text" >
										</div>
										<div class="col-md-1" style="height:30px;padding-top:6px;margin-left:-10px;">&nbsp;</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2"><font color="red">*</font>基价：</label>
										<div class="col-md-3">
											<input class="form-control col-md-12" validate="{required:true,isNoInteger:true}" name="basePrice" id="basePrice" value="<fmt:formatNumber type="number" value="${product.basePrice }" pattern="0.00" maxFractionDigits="2"/>" oninput="javascript: doReCalcPrice(this);">
										</div>
										<div class="col-md-1">
											<a href="#" class="glyphicon glyphicon-time" tabIndex='-1' style="padding-left:5px;padding-top:6px;" onclick="javascript: openPriceLog(1);"></a>
										</div>
										<label class="control-label col-md-2"><font color="red">*</font>模拟成本：</label>
										<div class="col-md-3">
											<input class="form-control col-md-12" validate="{required:true,isNoInteger:true}" name="simulationPrice" id="simulationPrice" value="<fmt:formatNumber type="number" value="${product.simulationPrice }" pattern="0.00" maxFractionDigits="2"/>">
										</div>
										<div class="col-md-1">
											<a href="#" class="glyphicon glyphicon-time" tabIndex='-1' style="padding-left:5px;padding-top:6px;" onclick="javascript: openPriceLog(2);"></a>
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2"><font color="red">*</font>市场价：</label>
										<div class="col-md-3">
											<div class="row">
												<div class="col-md-6">
													<input id="marketPriceLevel" type="hidden" name="marketPriceLevel" value="${product.marketPriceLevel }" />
													<select id="marketPriceLevelCombo" class="form-control col-md-12"><option value="">全部</option></select>
												</div>
												<div class="col-md-6">
													<input class="form-control col-md-12" validate="{isNoInteger:true}" name="marketPrice" id="marketPrice" value="<fmt:formatNumber type="number" value="${product.marketPrice }" pattern="0.00" maxFractionDigits="2"/>">
												</div>
											</div>
										</div>
										<div class="col-md-1">&nbsp;</div>
										<label class="control-label col-md-2"><font color="red">*</font>游客价：</label>
										<div class="col-md-3">
											<div class="row">
												<div class="col-md-6">
													<input id="touristPriceLevel" type="hidden" name="touristPriceLevel" value="${product.touristPriceLevel }" />
													<select id="touristPriceLevelCombo" class="form-control col-md-12"><option value="">全部</option></select>
												</div>
												<div class="col-md-6">
													<input class="form-control col-md-12" validate="{isNoInteger:true}" name="touristPrice" id="touristPrice" value="<fmt:formatNumber type="number" value="${product.touristPrice }" pattern="0.00" maxFractionDigits="2"/>">
												</div>
											</div>
										</div>
										<div class="col-md-1">&nbsp;</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2">最低限价：</label>
										<div class="col-md-3"><input class="form-control col-md-12" validate="{isNoInteger:true}" name="lowestPrice" id="lowestPrice" value="<fmt:formatNumber type="number" value="${product.lowestPrice }" pattern="0.00" maxFractionDigits="2"/>"></div>
									   	<div class="col-md-1">&nbsp;</div>
									   	
										<label class="control-label col-md-2"><font color="red">*</font>普通物流运费：</label>
										<div class="col-md-3"><input class="form-control col-md-12" validate="{required:true,isNoInteger:true}" name="normalDeliveryFee" id="normalDeliveryFee" value="<fmt:formatNumber type="number" value="${product.normalDeliveryFee }" pattern="0.00" maxFractionDigits="2"/>"></div>
									   	<div class="col-md-1">&nbsp;</div>
									</div>
									
									<div class="item form-group">
										<label class="control-label col-md-2"><font color="red">*</font>快递物流运费：</label>
										<div class="col-md-3">
											<input class="form-control col-md-12" validate="{required:true,isNoInteger:true}" name="expressDeliveryFee" id="expressDeliveryFee" value="<fmt:formatNumber type="number" value="${product.expressDeliveryFee }" pattern="0.00" maxFractionDigits="2"/>">
										</div>
										<div class="col-md-1">&nbsp;</div>
										<label class="control-label col-md-2"><font color="red">*</font>其他物流运费：</label>
										<div class="col-md-3">
											<input class="form-control col-md-12" validate="{required:true,isNoInteger:true}" name="otherDeliveryFee" id="otherDeliveryFee" value="<fmt:formatNumber type="number" value="${product.otherDeliveryFee }" pattern="0.00" maxFractionDigits="2"/>">
										</div>
										<div class="col-md-1">&nbsp;</div>
									</div>
									
									<%-- 
									<div class="item form-group">
										<label class="control-label col-md-2"><font color="red">*</font>预售定金比例（%）：</label>
										<div class="col-md-3">
											<input class="form-control col-md-12" validate="{required:true,isNoInteger:true}" name="depositRate" id="depositRate" value="<fmt:formatNumber type="number" value="${product.depositRate }" pattern="0.00" maxFractionDigits="2"/>">
										</div>
										<div class="col-md-1" style="height:30px;padding-top:6px;">%</div>
										<div class="col-md-6">&nbsp;</div>
									</div> 
									--%>
									
									<div class="item form-group">
										<div class="control-label col-md-2">&nbsp;</div>
										<div class="col-md-10">
											<table id="priceTable" class="table"></table>
										</div>
									</div>
								</div>
							</div>
							<div class="item form-group">
								<p>
									<input type="button" class="btn btn-default" value="上一步" style="margin-right:30px" onclick="javascript: doSelectTab('base');" />
									<input type="button" class="btn btn-primary" value="保存并下一步"  id="btnSavePrice" />
								</p>
							</div>
						</form>
					</div>
					<!-- 价格设置Tab end -->
					<!-- 规格设置 Tab begin -->
					<div id="normsTab" class="tab-pane fade">
						<form class="form-horizontal form-label-left" id="normsForm" name="normsForm" method="post"
							action="<%=basePath%>/product/addProductNorms">
							<div class="panel panel-default">
								<div class="panel-heading">规格设置 
									<button type="button" class="btn btn-success btn-xs" onclick="javascript: doCheckAllSpec();" style="margin-bottom: 5px;">全部选中</button>
									<button type="button" class="btn btn-warning btn-xs" onclick="javascript: doUnCheckAllSpec();" style="margin-bottom: 5px;">取消选中</button>
								</div>
								<div class="panel-body">
									<div class="item form-group">
										<div class="col-md-1" style="text-align:center; padding-top: 5px"><label>序号</label></div>
										<div class="col-md-1" style="text-align:center; padding-top: 5px"><label>规格名称</label></div>
										<div class="col-md-10" style="padding-top: 5px"><label>规格值</label></div>
									</div>
									<%-- 展示分类关联的规格 begin --%>
									<div id="productSpecDiv">
									</div>
									<%-- 展示分类关联的规格 end --%>
									
									<%-- 展示规格 begin --%>
									<%-- 展示规格 end --%>
									<div class="x_title">
										<div class="clearfix"></div>
									</div>
									<%-- 规格组合设置上下架 begin --%>
									<div class="item form-group">
										<input id="productSpecChose" type="hidden" value="${productSpecChose }" />
										<input id="specRelaColumns" type="hidden" value="${specRelaColumns }" />
										<span id="specRelaRows" style="display:none;">${specRelaRows }</span>
										<div class="col-md-3"><h4>批量上下架</h4></div>
										<div class="col-md-5">
											<div class="switch switch-small" oncolor="success" offcolor="warning" ontext="上架" offtext="下架">
												<div class="bootstrap-switch bootstrap-switch-wrapper bootstrap-switch-animate bootstrap-switch-on" style="width: 106px;">
													<div class="bootstrap-switch-container" style="width: 156px; margin-left: 0px;">
														<span id="onSpan" class="bootstrap-switch-handle-on btn-danger" style="width: 52px;"
															onclick="javascript: setAllOnStatus('onSpan',1);">上架</span>
														<span id="downSpan" class="bootstrap-switch-handle-off" style="width: 52px;"
																onclick="javascript: setAllOnStatus('downSpan',0);">下架</span>
													</div>
												</div>
											</div>
										</div>
									</div>
									<div id="productSpecSetDiv" class="col-md-12">
										<table id="productSpecSetTable" class="table"></table>
									</div>
									<%-- 规格组合设置上下架 end --%>
								</div>
							</div>
							<div class="item form-group">
								<p>
									<input type="button" class="btn btn-default" value="上一步" style="margin-right:30px" onclick="javascript: doSelectTab('price');" />
									<input type="button" class="btn btn-primary" value="保存并下一步"  id="btnSaveNorms" />
								</p>
							</div>
						</form>
					</div>
					<!-- 规格设置 Tab end -->
					<!-- 不可见设置 Tab begin -->
					<div id="visibleTab" class="tab-pane fade">
						<form class="form-horizontal form-label-left" id="visibleForm" name="visibleForm" method="post"
							action="<%=basePath%>/product/addProductVisible">
							<div class="panel panel-default">
								<div class="panel-body">
									<div class="alert alert-warning" role="alert"><i class="fa fa-info-circle fa-fw"></i>注意：选中的客户属性将设置为针对当前商品不可见！！！</div>
									<div class="item form-group" style="padding-right:10px;">
										<div class="row">
											<div class="col-md-3 col-sm-3 col-xs-3 txtCenter txtSize16">
												<b>客户属性选项</b>
												<a class="btn btn-success btn-xs" style="margin-bottom:10px;" onclick="loadProductInvisiable(true)">选中全部属性</a>
											</div>
											<div class="col-md-3 col-sm-3 col-xs-3 txtCenter txtSize16"><b>客户属性值</b></div>
											<div class="col-md-6 col-sm-6 col-xs-6 txtCenter txtSize16">
												<b>已选中的客户属性</b>
												<a class="btn btn-success btn-xs" style="margin-bottom:10px;" onclick="clearSelectedTarget()">清空选中属性</a>
											</div>
										</div>
										<div class="row">
											<div class="col-md-3 col-sm-3 col-xs-3" >
												<select class="col-md-12" size="10" id="customPropertyCombo" style="min-height:402px;">
													<option value="0">客户级别</option>
												</select>
											</div>
											<div class="col-md-3 col-sm-3 col-xs-3" id="targetsDiv" style="border: 1px #ddd solid;height:402px;padding-top: 10px;overflow-x:hidden;overflow-y:auto;">
											</div>
											<div class="col-md-6 col-sm-6 col-xs-6 target" id="choseTargetDiv" style="border: 1px #ddd solid;margin-top:0px;padding-top: 10px;word-wrap: normal;height:402px;overflow-y:auto;">
												<div class="selectedTargetDiv" >
													<dl class="selectedTargetDL" style="border-bottom: none;">
														<dd>
															<ul class="selectedTargetUL">
																
															</ul>
														</dd>
													</dl>
												</div>
											</div>
										</div>
									</div> 
								</div>
							</div>
							<div class="item form-group">
								<p>
									<input type="button" class="btn btn-default" value="上一步" style="margin-right:30px" onclick="javascript: doSelectTab('norms');" />
									<input type="button" class="btn btn-primary" value="保存并下一步"  id="btnSaveInvisible" />
								</p>
							</div>
						</form>
					</div>
					<!-- 不可见设置 Tab end -->
					<!-- 图文描述 Tab begin -->
					<div id="descTab" class="tab-pane fade">
						<form class="form-horizontal form-label-left" id="descForm" name="descForm" method="post"
							action="<%=basePath%>/product/saveProductDesc">
							<div class="panel panel-default">
								<div class="panel-heading">图文描述</div>
								<div class="panel-body">
									<div class="item form-group">
										<label class="control-label col-md-2" for="name">商品图片：</label>
										<div class="col-md-10 collapse navbar-collapse" id="bs-example-navbar-collapse-1">
											<div class="row">
												<div class="pull-left">
													<nav class="navbar navbar-default" role="navigation" style="padding: 10px; border-right: none;height:156px;" >
														<ul class="ipost-list ui-sortable js_fileList" id="proImgBox" style="height:120px;">
															<c:forEach items="${imgList }" var="img" varStatus="s">
																<li class="imgbox" draggable="true" id="imgli${s.index }" style="position: relative;">
																	<a class="item_new_close item_close" href="javascript: doDelImg(${s.index });" title="删除"></a>
																	<input type="hidden" value="${img.imagePath }" name="prodImage" >
																	<span class="item_box <c:if test="${img.imageType == 1 || s.index == 0  }">bgred</c:if>">
																		<a rel="productImg" href="<%=PublicConfig.IMG_ROOT_URL%>${img.imagePath }">
																			<img src="<%=PublicConfig.IMG_ROOT_URL%>${img.imagePath }?x-oss-process=image/resize,h_100/format,png">
																		</a>
																	</span>
																</li>
															</c:forEach>
														</ul>
													</nav>
												</div>
												<div class="uploadpic_pro pull-right" style="padding: 10px; border: 1px #ddd solid; background-color: #f8f8f8; padding-bottom: 24px; border-left: none;">
													<ul id="image_container">
														<li>
															<div class="pic1">
																<img src="${rootPath}/statics/images/upload_pic1.png" height="120px" width="120px" /> 
																<input id="uploadImage"
																	type="file" name="uploadImage" onchange="ajaxFileUpload(this)" />
															</div>
														</li>
													</ul>
												</div>
											</div>
											
												
										</div>
									</div>
									<script type="text/javascript">
										//图片拖动排序
										$(function(){
											$(".js_fileList").sortable({ 
												deactivate: function(event, ui) {
													try {
														$(".item_box").removeClass('bgred');
														$(".item_box").eq(0).addClass('bgred');
													} catch(e) {
														console.log(e);
													}
												} 
											});
										});
									</script>
									<div class="item form-group">
										<label class="col-md-2" for="name">&nbsp;</label>
										<div class="col-md-10" style="padding-top: 10px;">
											<label>最多只能上传<b> <font color="red">4</font> </b>张图片，默认第<b> <font color="red">一 </font></b>张图片为商品主图,以<b> <font color="red">红色</font> </b>背景标识。（建议图片尺寸<font color="red">800像素 X 800像素</font>，图片大小<font color="red">5MB</font>以内）</label>
											
										</div>
									</div>
									
									<%-- 
									<div class="item form-group">
										<label class="control-label col-md-2" for="name">商品图片：</label>
										<div class="col-md-10">
											<input id="files" type="file" multiple class="file" data-overwrite-initial="false" data-min-file-count="1">
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2" for="name">NEW-begin</label>
									</div>
									
									<div class="item form-group">
										<label class="control-label col-md-2 col-sm-2 col-xs-12" for="brandImage">商品图片: </label>
										<div class="col-md-6 col-sm-6 col-xs-12">
											<div class="uploadpic_part">
												<ul id="image_container">
													<li>
														<div class="pic1">
															<img src="${rootPath}/statics/images/upload_pic1.png" /> 
															<input id="uploadImage"
																type="file" name="uploadImage" onchange="ajaxFileUpload(this)" />
														</div>
													</li>
												</ul>
											</div>
											<span class="pictips">尺寸:800*800,大小不超过1M</span>
										</div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2" for="name">NEW-end</label>
									</div> 
									 --%>
									<div class="item form-group">
										<label class="control-label col-md-2" for="name">图文描述：</label>
										<div class="col-md-10">
										
										<script type="text/plain" id="editorDesc" style="width:100%;height:500px;margin-left: -10px;">${product.productIntro}</script>
										<script type="text/javascript">
											/*UE.getEditor('editorDesc',{});*/
											
											var ue = UE.getEditor('editorDesc',{
												//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
												//focus时自动清空初始化时的内容
												autoClearinitialContent:false,
												//关闭字数统计
												wordCount:false,
												imageUrlPrefix : '<%=PublicConfig.IMG_ROOT_URL%>',
												//默认的编辑区域高度
												initialFrameWidth:1260,
												//默认的编辑区域高度
												initialFrameHeight:500,
												//关闭elementPath
												elementPathEnabled:false
											});
											  
											UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
											UE.Editor.prototype.getActionUrl = function(action) {
												 if (action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage') {
													 return '<%=basePath%>/product/multiFileUeditorUpload.do';
												 } else {
													 return this._bkGetActionUrl.call(this, action);
												 }
											 } 
										</script>
										<%-- <input type="hidden" id="productIntro" name="productIntro" value="${product.productIntro }" /> --%>
										<span id="productIntro" name="productIntro" style="display: none;">${product.productIntro }</span>
										</div>
									</div>
									<br/>
									<br/>
								</div>
							</div>
							<div class="item form-group">
								<p>
									<input type="button" class="btn btn-default" value="上一步" style="margin-right:30px" onclick="javascript: doSelectTab('visible');" />
									<input type="button" class="btn btn-primary" value="保存并下一步"  id="btnSaveDesc" />
								</p>
							</div>
						</form>
					</div>
					<!-- 图文描述Tab end -->
					<!-- 关联商品 Tab begin -->
					<div id="relaTab" class="tab-pane fade">
						<form class="form-horizontal form-label-left" id="relaForm" name="relaForm" method="post"
							action="<%=basePath%>/product/addProductRela">
							<div class="panel panel-default">
								<div class="panel-heading">关联商品</div>
								<div class="panel-body">
									 <div class="item form-group">
										<div class="control-label col-md-2">商品状态：</div>
										<div class="col-md-10">
											<c:forEach items="${productStatusList }" var="status">
												<label class="control-label" for="productStatus" style="margin-right:50px;">
													<input name="productStatus" value="${status.keyValue }" type="radio"
														<c:if test="${product.productStatus == status.keyValue }"> checked="true" </c:if>
														 class="form-control">
													${status.keyIntro }
												</label>
											</c:forEach>
										</div>
									</div>
									<div class="item form-group">
										<div class="control-label col-md-2">是否在报价单展示：</div>
										<div class="col-md-10">
											<label class="control-label" for="isQuato" style="margin-right:50px;">
												<input name="isQuato" value="1" type="radio"
													<c:if test="${product.isQuato eq 1 }"> checked="true" </c:if>
												class="form-control">&nbsp;是
											</label>
											
											<label class="control-label" for="isQuato" style="margin-right:50px;">
												<input name="isQuato" value="0" type="radio"
													<c:if test="${product.isQuato eq 0 }"> checked="true" </c:if>
												class="form-control">&nbsp;否
											</label>
										</div>
									</div>
									
									<div class="item form-group">
										<div class="control-label col-md-2">游客是否可见：</div>
										<div class="col-md-10">
											<label class="control-label" for="touristVisible" style="margin-right:50px;">
												<input name="touristVisible" value="1" type="radio"
													<c:if test="${product.touristVisible eq 1 }"> checked="true" </c:if>
												class="form-control">&nbsp;是
											</label>
											
											<label class="control-label" for="touristVisible" style="margin-right:50px;">
												<input name="touristVisible" value="0" type="radio"
													<c:if test="${product.touristVisible eq 0 }"> checked="true" </c:if>
													class="form-control">&nbsp;否
											</label>
										</div>
									</div>
									
									
									<div class="item form-group">
										<div class="control-label col-md-2">商品显示权重：</div>
										<div class="col-md-3">
											<input type="hidden" id="sortWeightTxt" value="${product.sortWeight }" />
											<select class="selectpicker form-control col-md-3" id="sortWeight" placeholder="请选择商品显示权重">
											</select>
										</div>
									</div>
									<div class="item form-group">
										<div class="control-label col-md-2">预售商品到货日期：</div>
										<div class="col-md-3 datetime">
											<input type="hidden" id="depositDeliveryDayTxt" value="<fmt:formatDate value="${product.depositDeliveryDay }" pattern="yyyy-MM-dd" />"/>
											<input id="depositDeliveryDay" name="depositDeliveryDay" value="<fmt:formatDate value="${product.depositDeliveryDay }" pattern="yyyy-MM-dd" />" class="form-control col-md-3" placeholder="请输入预售商品到货日期" type="text" >
											<i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
										</div>
									</div>
									<div class="x_title">
										<div class="clearfix"></div>
									</div>
									<div class="item form-group">
										<label class="control-label col-md-2">商品编码：</label>
										<div class="col-md-2"><input id="searchProductCode" class="form-control col-md-12"  type="text" ></div>
										<label class="control-label col-md-2">商品名称：</label>
										<div class="col-md-2"><input id="searchProductName" class="form-control col-md-12"  type="text" ></div>
										<!-- 
										<label class="control-label col-md-1">商品分类：</label>
										<div class="col-md-2"><input id="searchProductCategory" class="form-control col-md-12"  type="text" ></div>
										 -->
										<div class="pull-right">
											<a class="btn btn-danger" id="btnClear"><i class="fa fa-trash-o fa-fw"></i>清空</a> 
											<a class="btn btn-primary search" id="btnQuery"><i class="fa fa-search-plus fa-fw"></i>查询</a>
										</div>
									</div>
									<div class="item form-group">
										<table id="productRelaSearchTable" class="table"></table>
									</div>
									<div class="item form-group">
										<div class="col-md-12"><h4>已选关联商品</h4></div>
									</div>
									<div class="item form-group">
										<table id="productRelaChoseTable" class="table"></table>
									</div>
								</div>
							</div>
							<div class="item form-group">
								<p>
									<input type="button" class="btn btn-default" value="上一步" style="margin-right:30px" onclick="javascript: doSelectTab('desc');" />
									<input type="button" class="btn btn-primary" value="保存"  id="btnSaveRela" />
								</p>
							</div>
						</form>
					</div>
					<!-- 关联商品 Tab end -->
				</div>
			</div>
		</div>
	</div>
	
	
<!-- 不使用模版，商品属性选择弹出层 begin -->
<div class="modal fade" id="productPropertyModal" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="productPropertyModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width: 60%;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="productPropertyModalLabel">选择商品属性</h4>
			</div>
			<div class="modal-body">
				<table id="productPropertyTable" class="table"></table>
			</div>
			<div class="modal-footer">
				<!-- <button type="button" class="btn btn-primary" onclick="javascript: doGetProperties();">确认选择</button> -->
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
</div>
<!-- 不使用模版，商品属性选择弹出层 end -->

<!-- 价格日志 begin -->
<div class="modal fade" id="productPriceModal" tabindex="-1" data-backdrop="static" role="dialog" aria-labelledby="productPriceModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width: 60%;">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="productPriceModalLabel">价格修改日志</h4>
			</div>
			<div class="modal-body">
				<table id="productPriceTable" class="table"></table>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div>
	</div>
</div>
<!-- 价格日志 end -->








</body>
<script type="text/javascript" src="<%=basePath%>/statics/js/jquery.form.js"></script>
<script type="text/javascript" src="<%=basePath%>/statics/js/jquery.validate.js"></script>
<script type="text/javascript" src="<%=basePath%>/statics/plugins/upload/ajaxfileupload.js"></script>
<script type="text/javascript" src="<%=basePath%>/statics/js/jquery.metadata.js"></script>
<script type="text/javascript" src="${rootPath }/statics/js/jquery.select-1.3.6.js"></script>
<script type="text/javascript" src="${rootPath }/statics/plugins/bootstrap-daterangepicker/moment.min.js"></script>
<script type="text/javascript" src="${rootPath }/statics/plugins/bootstrap-daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="<%=basePath%>/statics/plugins/iCheck/icheck.min.js"></script>

<script type="text/javascript" src="<%=basePath%>/js/product/product_form.js?v=20180428"></script>

<script type="text/javascript">
	/* 定位基本信息Tab */
	doSelectTab('base');
	function checkDetail(){
		var proDe = UE.getEditor('editorDesc').getContent();
		if(""==proDe || null==proDe){
			getId("errorDetail").style.display = "";
			return ;
		}else{
			getId("sureDetail").style.display = "none";
			document.getElementById("productIntro").value=UE.getEditor('editorDesc').getContent().replace('u-pro','<%=PublicConfig.IMG_ROOT_URL%>');
			return true;
		}
	}
</script>
</html>